package org.jeecg.modules.flow.record.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.flow.record.entity.WmsDocumentTypeStatusUser;
import org.jeecg.modules.flow.record.entity.vo.StatusReminderUserVO;
import org.jeecg.modules.flow.record.service.IWmsDocumentTypeStatusUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description: 流程配置提醒消息人发送人
 * @Author: jeecg-boot
 * @Date: 2023-11-30
 * @Version: V1.0
 */
@Api(tags = "流程配置提醒消息人发送人")
@RestController
@RequestMapping("/flow/wmsDocumentTypeStatusUser")
@Slf4j
public class WmsDocumentTypeStatusUserController extends JeecgController<WmsDocumentTypeStatusUser, IWmsDocumentTypeStatusUserService> {
    @Autowired
    private IWmsDocumentTypeStatusUserService wmsDocumentTypeStatusUserService;

    /**
     * 分页列表查询
     *
     * @param reminderId
     * @return
     */
    @ApiOperation(value = "流程配置提醒消息人发送人-分页列表查询", notes = "流程配置提醒消息人发送人-分页列表查询")
    @GetMapping(value = "/info")
    public Result<StatusReminderUserVO> queryPageList(@RequestParam(value = "reminderId") String reminderId) {
        return Result.OK(wmsDocumentTypeStatusUserService.getStatusReminderUser(reminderId));
    }

    /**
     * 更新
     *
     * @param wmsDocumentTypeStatusUser
     * @return
     */
    @AutoLog(value = "流程配置提醒消息人发送人-更新")
    @ApiOperation(value = "流程配置提醒消息人发送人-更新", notes = "流程配置提醒消息人发送人-更新")
    @PostMapping(value = "/update")
    public Result<String> add(@RequestBody WmsDocumentTypeStatusUser wmsDocumentTypeStatusUser) {
        wmsDocumentTypeStatusUserService.updateById(wmsDocumentTypeStatusUser);
        return Result.OK("保存成功！");
    }

}
